SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)

FUNCTION(ADD_BF_TEST TEST_NAME TEST_SOURCE)
    ADD_EXECUTABLE(bf_test_${TEST_NAME} ${TEST_SOURCE})
    TARGET_LINK_LIBRARIES(bf_test_${TEST_NAME} BrainFuck_Lib)
    ADD_TEST(NAME bf_test_${TEST_NAME} COMMAND $<TARGET_FILE:bf_test_${TEST_NAME}>)
ENDFUNCTION()

FUNCTION(SET_BF_TEST_PASS TEST_NAME PASS_STR)
    SET_TESTS_PROPERTIES(bf_test_${TEST_NAME} PROPERTIES PASS_REGULAR_EXPRESSION ${PASS_STR})
ENDFUNCTION()

ADD_BF_TEST(str test_str.c)
SET_BF_TEST_PASS(str "Hello World!")